const User = require('./models/User')
const db = require('./config/database')

async function testUserModel () {
  try {
    console.log('🧪 测试 User.getList 方法...')

    const result = await User.getList(1, 5, '')

    console.log('✅ 获取用户列表成功:')
    console.log('用户数量:', result.users.length)
    console.log('总数:', result.total)
    console.log('用户数据:')
    console.table(result.users)
  } catch (error) {
    console.error('❌ 获取用户列表失败:', error)
    console.error('错误详情:', error.message)
    console.error('SQL错误:', error.sql)
  } finally {
    process.exit(0)
  }
}

testUserModel()
